package Exception;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 子类重写超类含有throws异常声明的方法时，对throws的重写规则
 */
public class ThrowsDemo {
    public void doSome() throws IOException, AWTException {}
}

class SubClass extends ThrowsDemo{
    //public void doSome() throws IOException, AWTException{}

    //1.允许仅抛出超类方法抛出的部分异常
    //public void doSome() throws IOException{}

    //2. 允许抛出超类方法抛出异常的子类异常
    //public void doSome() throws FileNotFoundException{}

    //3. 允许不抛出异常
    //public void doSome(){}
}